package com.geek.novel.common

/**书籍下载中的枚举*/
enum class BookDownloadEnum(val typeCode: Int, val typeName: String){
    /**未开始*/
    DEFAULT(0, "未开始"),
    /**下载中*/
    DOWNLOADING(1, "下载中"),
    /**已完成*/
    FINISH(2, "已完成"),
    /**已暂停*/
    PAUSE(-1, "已暂停");

    fun equalsCode(code: Int): Boolean{
        return this.typeCode == code
    }

    companion object{
        fun find(typeCode: Int): BookDownloadEnum? {
            return values().find { typeCode == it.typeCode }
        }
    }

}